

// 职位列表
const mongoose = require('mongoose')
const PositionsSchema = new mongoose.Schema({
    // 用户id
    // user_id: {
    //     type: String,
    //     required: true
    // },
    // // 简历id
    // resumes_id: {
    //     type: String,
    //     required: true
    // },
    // // 岗位投递数
    // deliverCount: {
    //     type: Number,
    //     required: true,
    //     default: 0
    // },
    // mongoose默认产生的字段，不需要展示
    __v: {
        type: Number,
        select: false
    },
    // 职位名称
    title: {
        type: String,
        required: true
    },
    // 职位描述
    description: {
        type: String,
        required: true
    },
    // 职位要求
    requirement: {
        type: String,
        required: true
    },

    // 城市
    city_list: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'CityLists',
        required: true
    },
    // 社招 校招
    job_type: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'JobTypes',
        required: true
    },
    // 正式 实习
    recruit_type: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'RecruitTypes',
        required: true
    },
    // 招聘项目
    job_project: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'JobProjects',
        required: true
    },
    // 职能分类
    job_function: {
        type: mongoose.Schema.Types.ObjectId,
        ref: 'JobFunctions',
        required: true
    },

}, { timestamps: true })
module.exports = mongoose.model('Positions', PositionsSchema)
